package jeons.member.biz.impl;

import java.util.List;

import jeons.member.biz.MemberBiz;
import jeons.member.dto.MemberDTO;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class MemberBizImpl extends SqlMapClientDaoSupport implements MemberBiz{
	@Autowired SqlMapClientTemplate sqlMapClientTemplate;
	
	/* (non-Javadoc)
	 * @see jeons.member.biz.MemberBiz#insertMember(jeons.member.dto.MemberDTO)
	 * 회占쏙옙占쏙옙
	 */
	
	@Override
	public MemberDTO insertMember(MemberDTO memberDTO) {
		return (MemberDTO) sqlMapClientTemplate.insert("Member.insertMember",memberDTO);
	}

	/* (non-Javadoc)
	 * @see jeons.member.biz.MemberBiz#getDataID(java.lang.String)
	 * 占쏙옙占싱듸옙講占�
	 */
	@Override
	public String getDataID(String u_id) {
		return (String) sqlMapClientTemplate.queryForObject("Member.getDataID",u_id);
	}
	

	/* (non-Javadoc)
	 * @see jeons.member.biz.MemberBiz#getDataPassword(java.lang.String)
	 * 占쏙옙占싯삼옙
	 */
	public MemberDTO getDataPassword(MemberDTO memberDTO) {
		return (MemberDTO) sqlMapClientTemplate.queryForObject("Member.getDataPassword",memberDTO);
	}

	/* (non-Javadoc)
	 * @see jeons.member.biz.MemberBiz#getDataUser(java.lang.String)
	 * 회占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙
	 */
	@Override
	public MemberDTO getDataUser(String u_id) {
		return (MemberDTO) sqlMapClientTemplate.queryForObject("Member.getDataUser",u_id);
	}

	/**
	 * <PRE>
	 * 1. MethodName : minusPoint
	 * 2. ClassName  : MemberBizImpl
	 * 3. Comment   : 占쏙옙占쏙옙트占쏙옙占쏙옙
	 * 4. 占쌜쇽옙占쏙옙    : Administrator
	 * 5. 占쌜쇽옙占쏙옙    : 2012. 2. 5. 占쏙옙占쏙옙 10:03:26
	 * </PRE>
	 *   @param memberDTO
	 */
	@Override
	public void minusPoint(MemberDTO memberDTO) {
		sqlMapClientTemplate.update("Member.minusPoint",memberDTO);
		
	}

	@Override
	public void plusPoint(MemberDTO memberDTO) {
		sqlMapClientTemplate.update("Member.plusPoint",memberDTO);
		
	}

	@Override
	public void InfoModify(MemberDTO memberDTO) {
		sqlMapClientTemplate.update("Member.InfoModify",memberDTO);
		
	}
	
	@Override
	public MemberDTO getDataUserNo(int userno) {
		return (MemberDTO) sqlMapClientTemplate.queryForObject("Member.getDataUserNo",userno);
	}

	@SuppressWarnings("unchecked")
	public List<MemberDTO> getSearchID(MemberDTO memberDTO) {
		return  (List<MemberDTO>) sqlMapClientTemplate.queryForList("Member.getSearchID",memberDTO);
	}

	@Override
	public MemberDTO getSearchPWD(MemberDTO memberDTO) {
		return (MemberDTO) sqlMapClientTemplate.queryForObject("Member.getSearchPWD", memberDTO);
	}

	/**
	* @Method Name  : updatePWD
	* @작성일   : 2012. 2. 24.
	* @작성자   : user
	* @변경이력  :
	* @Method 설명 :
	* @param memberDTO
	*/
	@Override
	public void updatePWD(MemberDTO memberDTO) {
		sqlMapClientTemplate.update("Member.updatePWD",memberDTO);
		
	}


	
}
